﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditOrder.aspx.cs" Inherits="SampleWeb.EditOrder" %>
<%@ Import Namespace="Model.Entities" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <b>WebForm EditOrder</b>
        <table style="border: none">
            <tr>
                <td>Kund:</td>
                <td><asp:DropDownList ID="ddCompany" runat="server" DataTextField="Name" DataValueField="Id" AutoPostBack="True"></asp:DropDownList></td>
            </tr>
            <tr>
                <td colspan="2"><hr/></td>
            </tr>
            <tr>
                <td>Order:</td>
                <td><asp:DropDownList ID="ddOrder" runat="server" DataTextField="OrderNumber" DataValueField="Id" AutoPostBack="True"></asp:DropDownList></td>
            </tr>
            <tr>
                <td>OrderNr:</td>
                <td><asp:TextBox ID="tbOrderNo" runat="server"></asp:TextBox></td>
            </tr>
        </table>
        <b>Orderrader</b>
        <asp:GridView ID="grvOrderRows" runat="server" AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderText="Namn">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# ((Product)Eval("Product")).Name %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Product.Name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Antal">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Count") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Count") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    
    </form>
</body>
</html>
